//
//  OpenAPIServices.h
//  doubleEduStudents
//
//  Created by 盛洋 on 2021/2/18.
//  Copyright © 2021 shengYang. All rights reserved.
//

#import <Foundation/Foundation.h>

NS_ASSUME_NONNULL_BEGIN

@protocol OpenAPIServicesDelegate<NSObject>
@optional
- (void)shareSuccese;
- (void)openLoginSucce:(UMSocialUserInfoResponse *)userData snsName:(UMSocialPlatformType)snsName;
//第三方登录失败
- (void)openFailed:(UMSocialUserInfoResponse *)response;

@end


@interface OpenAPIServices : NSObject{
    NSString *shareInfoID;
}

@property(weak,nonatomic)id<OpenAPIServicesDelegate> delegate;

+ (OpenAPIServices*)sharedService;

/**
 *  设置友盟分享,统计,自动更新
 */
- (void)setUmengAppKey;

/**
 *  根据平台名，返回平台对象
 *
 *  @param controller 控制器
 *  @param snsName    社交平台名称
 */
- (void)setPlatformSSO:(UIViewController*)controller platformName:(UMSocialPlatformType)snsName;

/**
 *  信息分享
 *
 *  @param controller   控制器 self
 *  @param _stringURL   分享链接
 *  @param _titleString 分享标题
 *  @param image        分享图片
 *  @param desc         描述
 */
- (void)shareInfo: (UIViewController*)controller urlString:(NSString*)_stringURL titleString:(NSString *)_titleString titleImage:(UIImage *)image desc:(NSString*)desc infoID:(NSString*)infoID;
- (BOOL)handleOpenURL:(NSURL *)url;
- (BOOL)handleOpenURL:(NSURL *)url sourceApplication:sourceApplication annotation:annotation;

@end

NS_ASSUME_NONNULL_END
